@import '../../app/variables';

.form {
  & .word {
    display: inline-block;
    width: auto;
    background: transparent;
    padding: 0;
    font-size: 26px;
    line-height: 80px;
    height: 80px;
    margin: 0 5px;

    &.missing {
      width: 100px;

      & input,
      & textarea {
        text-shadow: 0px 0px 15px rgba(0, 0, 0, 1);
        color: rgba(0, 0, 0, 0);
        font-size: inhert;
        line-height: inhert;
        height: inhert;
        border: none;
        text-align: center;
      }
    }
  }

  & fieldset {
    border: 0;
    display: inline;
    vertical-align: top;
    padding-top: 42px;

    & .placeholder {
      border-top: solid 2px var(--color-black);
      width: 100%;
      height: 32px;
      display: block;
      font-size: 0;
    }

    & label.option {
      display: block;
      color: var(--color-primary-standard);
      border: solid 2px var(--color-primary-standard);
      border-radius: 3px;
      padding: 0 15px;
      line-height: 50px;
      font-size: 22px;
      margin: 8px 0;
      cursor: pointer;
      transition: all ease 200ms;
    }

    & input.option {
      visibility: hidden;
      position: absolute;
    }
  }

  &.clean {
    & input:checked + label {
      background-color: var(--color-primary-standard);
      color: var(--color-white);
    }
  }

  &.invalid {
    & input:checked + label {
      background-color: var(--color-action-dark);
      border-color: var(--color-action-dark);
      color: var(--color-white);
    }
  }

  &.outOfTrials {
    & input + label {
      opacity: 0.2;
      cursor: auto;
      pointer-events: none;
    }
  }

  &.valid {
    & input:checked + label {
      background-color: var(--color-success-dark);
      border-color: var(--color-success-dark);
      color: var(--color-white);
    }
  }
}

@media (--medium-viewport) {
  .form {
    & fieldset label.option,
    & .word {
      font-size: 22px;
    }
  }
}

@media (--small-viewport) {
  .form {
    padding-bottom: 120px;

    &.invalid .placeholder {
      border-color: var(--color-error) !important;
      color: var(--color-error) !important;
    }

    &.valid .placeholder {
      border-color: var(--color-success-dark) !important;
      color: var(--color-success-dark) !important;
    }

    & fieldset,
    & .word {
      display: block;
      clear: both;
    }

    & fieldset label.option,
    & .word {
      font-size: 18px;
      font-weight: 600;
    }

    & .word {
      line-height: 52px;
      height: 52px;
    }

    & fieldset {
      padding: 2px 0;
      height: 48px;
      line-height: 48px;

      & .placeholder {
        color: var(--color-primary-standard);
        border: solid 2px var(--color-primary-standard) !important;
        border-radius: 3px;
        height: 44px;
        line-height: 44px;
        width: 100px !important;
        margin: 0 auto;
        cursor: pointer;
        font-weight: 700;
        font-size: 18px;
        transition: all ease 200ms;

        &::after {
          font-size: 18px;
          font-weight: 600;
        }

        &.selected {
          & ~ div:last-child::after,
          & ~ div {
            bottom: 0;
          }
        }

        &:empty::after {
          content: '?';
        }

        &.selected:empty::after {
          content: '...';
        }
      }

      & input:checked + label {
        background: transparent !important;
        color: var(--color-primary-standard) !important;
      }

      & > div {
        width: 33.33%;
        position: fixed;
        bottom: -80px;
        height: 60px;
        transition: all ease 200ms;

        &:nth-child(2) {
          left: 0;
          z-index: 3;
        }

        &:nth-child(3) {
          left: 50%;
          transform: translateX(-50%);
          z-index: 2;
        }

        &:last-child {
          right: 0;
          left: auto;

          &::after {
            content: '';
            display: block;
            width: 100%;
            height: 52px;
            left: 0;
            bottom: -80px;
            position: fixed;
            z-index: 0;
            transition: all ease 200ms;
            background: var(--color-white);
            box-shadow: 0 -1px 12px 0 rgba(60, 80, 104, 0.26);
          }
        }
      }

      & .option {
        border: none !important;
        margin: 0 !important;
        height: 60px;
        line-height: 60px !important;
        position: relative;
        z-index: 3;
      }
    }
  }
}
